package com.xdq.service.impl;

import com.xdq.bean.User;
import com.xdq.repository.UserRepository;
import com.xdq.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author: 徐东强
 * @date: 2018/9/27 上午11:34
 * @description:
 **/
@Service
public class UserServiceImpl implements UserService {

    private final UserRepository userRepository;

    public UserServiceImpl(UserRepository userRepository){
        this.userRepository = userRepository;
    }

    @Override
    public Optional<User> findUserByName(String name) {
        return this.userRepository.findByName(name);
    }
}
